package com.hu.hutool;

import com.commons.tools.utils.SpringContextUtil;
import com.hu.hutool.AwareTest.ApplicationContextAwareUtil;
import com.hu.hutool.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;

/**
 * @Author CazCen
 * @Date 2021/11/12 0:15
 */
@SpringBootTest
@Slf4j


public class Aware {

    @Autowired
    SpringContextUtil contextUtil;

    @Test
    public void test01() {


        ApplicationContext applicationContext = ApplicationContextAwareUtil.getApplicationContext();
        User bean = applicationContext.getBean(User.class);

    }

}
